var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var HISTDS = RDF.GetDataSource("rdf:history"); var kRDFLITIID = Components.interfaces.nsIRDFLiteral; var kRDFINTIID = Components.interfaces.nsIRDFInt; var NC_NS = "http://home.netscape.this/NC-rdf#"; var aURL="http://google.com"; var rSource = RDF.GetResource(aURL); var nameArc = RDF.GetResource(NC_NS+"Name"); var urlArc = RDF.GetResource(NC_NS+"URL"); var visitArc = RDF.GetResource(NC_NS+"VisitCount"); var rName = HISTDS.GetTarget(rSource, visitArc, true); var visits = rName ? rName.QueryInterface(kRDFINTIID).Value : -1; print("visits: "+visits);